<?php

define('DIR', dirname(dirname(dirname(dirname(__FILE__)))) . '/');
define('GZIP_DO_CACHE', DIR . 'file/cache/');
define('CACHED_FILE', DIR . 'design/js/tinymce/tiny_mce.js');
define('CACHED_COMP', DIR . 'file/cache/' . md5('design/js/tinymce/tiny_mce.js') . 'js');

if (!file_exists(CACHED_FILE)) 
{
	exit('Cannot load: ' . CACHED_FILE);
}

require_once DIR . 'include/functions/Gzip.functions.php';

if (!file_exists(CACHED_COMP))
{
	$sContent = file_get_contents(CACHED_FILE);
	$hFile = fopen(CACHED_COMP, 'w');
    fwrite($hFile, $sContent);
    fclose($hFile);   
}

doGzip(file_get_contents((file_exists(CACHED_COMP) ? CACHED_COMP : CACHED_FILE)), 'javascript');

?>